package com.itheima.springmvc.controller;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class Test {

	public static void main(String[] args) {
		List<Integer> numbers = new ArrayList<>();
		Random rd = new Random();
		while (numbers.size() < 7) {
			Integer number = rd.nextInt(10) + 1;
			boolean isEquals = false;
			for (Integer i : numbers) {
				if(number.equals(i)) {
					isEquals = true;
					break;
				}
			}
			if (!isEquals) {
				numbers.add(number);
			}
		}
		Collections.sort(numbers);
		for (Integer i : numbers) {
			System.out.println(i);
		}

	}

}
